<?php

/**
 * Error Message Class to handle alll message types and codes
 *
 * @package SGN_Core
 * @version $Id: Application.php 1424 2012-03-03 08:15:52Z locth $
 * @author $Author: locth $
 *
 */
class SGN_ErrorCode
{
    const COMMENT_NEWCOMMENT_DISABLED = -4;
    const COMMENT_TIMEBETWEENPOST_ERROR = -3;
    const COMMENT_ITSNOTYOURCHAR = -2;
    const PROFILE_UPLOADPICTURE_CREATEDIR_ERROR = 3001;
    const PROFILE_USER_NOT_EXIST = 3002;
    /**
     * Get error message of a value. It's actually the constant's name
     * @param integer $value
     * 
     * @return string
     */
    public static function getErrorMessage($value)
    {
        $class = new ReflectionClass('SGN_ErrorCode');
        $constants = $class->getConstants();
        $constants = array_flip($constants);
        return $constants[$value];
    }
}